<?php
echo "<center>";
echo "<div style='margin:43px'></div>";
echo "<font size='2' face='Arial, Helvetica, sans-serif' color='white'>";
echo "<table width='100%' border='0' cellspacing='0' cellpadding='0'>";
$a = 1;
$SQLawow ="SELECT * FROM characters WHERE banned='' AND killsLifeTime<>'0' ORDER BY killsLifeTime DESC"; 
$bestchar = mysql_query($SQLawow, $char) or die("Error #1: ".mysql_error());
while ($bestchar2 = mysql_fetch_array($bestchar))
{
	if ($a<=5)
	{     
		$SQLwow = "SELECT gm,banned from accounts where acct='$bestchar2[acct]'";
		$SQLwow2 = mysql_query($SQLwow, $logon) or die("Error: ".mysql_error());
		$SQLwow3 = mysql_fetch_array($SQLwow2);

		if ($SQLwow3[0] == "" && $SQLwow3[1] == "0") { //no gm's and banned accs
			$a = $a + 1;
		if ($char2[race]=="1" || $char2[race]=="3" || $char2[race]=="4" || $char2[race]=="7" || $char2[race]=="11") {
			$side = "0";
		}
		else {
			$side = "1";
		}
		if ($char2[online]=="1") {
			$onl = $OnlineColor;
		}
		else {
			$onl = "white"; // config offline color doesnt match here
		}
		echo "<tr><td align='center'><img src='forum/images/pvpranks/rank$bestchar2[pvprank].gif' title='Rank $bestchar2[pvprank]' />";
		echo "<td align='center' style='font-size:14px'><strong>$bestchar2[killsLifeTime]</strong> HK's</td>";
		echo "<td align='center'><font color='$onl'>$bestchar2[name]</font></td>";
		echo "<td align='center'>lvl <strong>$bestchar2[level]</strong></td>";
		echo "<td align='center'><img src='forum/images/class/$bestchar2[class].gif' title='Class' />&nbsp;<img src='forum/images/race/$bestchar2[race]-$bestchar2[gender].gif'  title='Race' />&nbsp;&nbsp;<img src='forum/images/pvpranks/rank_default_$side.gif'  title='Race' /></td>";
		echo "<td align='left'></td>";
		echo "</tr>";
		}
	}
}
echo "</table>";
echo "</font>";
echo "</center>";
?>